<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> - 联系人</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="__PUBLIC__/admin/favicon.ico">
    <link href="__PUBLIC__/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/animate.css" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <style>
        body{padding: 20px;}
        .demo-input{padding-left: 10px; height: 38px; min-width: 262px; line-height: 38px; border: 1px solid #e6e6e6;  background-color: #fff;  border-radius: 2px;}
        .bt_backcolor{
            background-color: gray;
        }
        .bt_backcolor:hover{
            background-color: gray!important;
        }
        .limit{
            background-color: gray;
            color: white;
            border-radius: 16px;
        }
    </style>
</head>
<include file="Admin@Index:cache" />
<body class="gray-bg contacts" oncopy="copyval()">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox">
                    <div class="ibox-content">
                        <h5>逾期管理-
                            <small>逾期分配</small>
                        </h5>
                        <div class="col-sm-12" style="margin-bottom: 1rem">
                            <form role="form"  id="my_form" action="__MODULE__/LoanManage/overdue_operate" method="get">
                                <div class="form-group">
                                    <input type="text" id="content" placeholder="" name="key" class="form-control" value="<{$search.key}>">
                                </div>
                                <div>
                                    <label>还款时间</label>
                                    <input style="height: 2.5rem;padding: 3px" type="text" class="demo-input" placeholder="选择时间" id="should_time" name="should_time" value="<{$search.should_time}>">
                                    <!--<label style="margin-left: 10px">审核时间</label>-->
                                    <!--<input style="height: 2.5rem;padding: 3px" type="text" class="demo-input"  placeholder="选择时间" id="cert_time" name="cert_time" value="<{$search.cert_time}>">-->
                                    <!--<select class="form-control m-b" name="channel" id="select_channel" style="margin: 0px 10px 0px 10px;padding-top: 3px;display: inline;width: 11%;" >-->
                                        <!--<option value="">渠道商</option>-->
                                        <!--&lt;!&ndash;<option value="0">自增</option>&ndash;&gt;-->
                                        <!--<volist name="channel" id="vo">-->
                                            <!--<option value="<{$vo.chan_id}>" ><{$vo.channel_name}></option>-->
                                        <!--</volist>-->
                                    <!--</select>-->
                                    <span>每页显示</span>
                                    <select onchange="submit_form()" class="form-control m-b" name="show_num"  id="show_num" style="margin-bottom: 0;padding-top: 3px;display: inline;width: 11%;" >
                                        <option value="10">10</option>
                                        <option value="20">20</option>
                                        <option value="50">50</option>
                                        <option value="100">100</option>
                                    </select>
                                    <span>条</span>
                                    <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit" id="search"><strong>搜索</strong>
                                    </button>
                                </div>
                            </form>
                        </div>
                        <br>
                        <div style="display: block;margin-left: 15px">
                                    <input type="submit"  onclick="send()" class="btn btn-sm btn-primary" value="》分配">


                        </div>

                        <div class="ibox-content">
                            <table class="table table-striped  table-hover" id="sample-table">
                                <tbody>
                                <tr>
                                    <th><input id="all_check" type="checkbox" level="1" style="width: 20px;height: 20px"></th>
                                    <th>订单号</th>
                                    <th>用户手机</th>
                                    <th>用户姓名</th>
                                    <th>借款金额</th>
                                    <th>滞纳金</th>
                                    <th>逾期天数</th>
                                    <th>应还时间</th>
                                    <!--<th>操作</th>-->
                                </tr>
                                <volist name="data" id="vo">
                                    <tr>
                                        <td><input  type="checkbox"  name="send_check" id="<{$vo.id}>" value="<{$vo.id}>" style="width: 20px;height: 20px" >  </td>
                                        <td><{$vo.numbering}></td>
                                        <td><{$vo.mobile}></td>
                                        <td><{$vo.username}></td>
                                        <td><{$vo.repayment_money}></td>
                                        <td><{$vo.overdue_money}></td>
                                        <td><{$vo.overdue_day}></td>
                                        <td><{$vo.should_time}></td>
                                        <!--<td id="th_<{$vo.id}>">-->

                                                    <!--<a target="_blank" class="btn btn-success btn-rounded"-->
                                                       <!--href="javascript:;" onclick="distribute('<{$vo.id}>','<{$vo.mobile}>')"-->
                                                       <!--title="分配">分配</a>-->

                                        <!--</td>-->
                                    </tr>
                                </volist>
                                </tbody>
                            </table>
                        </div>
                        <ul class="pagination">
                                <{$fpage}>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="__PUBLIC__/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="__PUBLIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>

<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<script src="__PUBLIC__/admin/js/laydate/laydate.js"></script>
<script src="__PUBLIC__/admin/js/layer/layer.js"></script>
<script src="__PUBLIC__/admin/js/layui/layui.js"></script>

<script>
    function submit_form() {
        var form = document.getElementById('my_form');
        form.submit();
    }
    //select赋值
    var option2="<{$search.show_num}>";
    $('#show_num').val(option2);

    //select赋值
    var option="<{$search.channel}>";
    $('#select_channel').val(option);

    //多选框操作
    var isCheckAll=false;
    $("#all_check").click(function(){
        if (isCheckAll) {
            $("input[type='checkbox']").each(function() {
                this.checked = false;
            });
            isCheckAll = false;
        } else {
            $("input[type='checkbox']").each(function() {
                this.checked = true;
            });
            isCheckAll = true;
        }

    });

    //批量分配
    function send() {
        var index = layer.load(1, {
            shade: [0.1, '#fff'] //0.1透明度的白色背景
        });

        var obj=document.getElementsByName("send_check");
        var  txt="";
        var i;
        for ( i=0;i<obj.length;i++){
            if (obj[i].checked){
                txt=txt+obj[i].value+",";
            }
        }
        var txt1=txt.substring(0,txt.length-1);

        if (txt.length<=0) {
            layer.close(index);
            layer.alert("请选择！\r\n", {
                title: '提示框',
                icon: 0,
            });
            return false;
        }
        layer.open({
            title:'审核分配',
            type: 2,
            area: ['35%', '50%'],
            maxmin: true,
            offset:'100px',
            content: '__MODULE__/LoanManage/user_distribute.html?id='+txt1,
            success: function(layero){
                layero.find('.layui-layer-min').remove();
            }
        });
        layer.close(index);
    }
    //单个分配
    function distribute(id,mobile) {
        layer.open({
            title:'审核分配',
            type: 2,
            area: ['35%', '50%'],
            maxmin: true,
            offset:'100px',
            content: '__MODULE__/LoanManage/user_distribute.html?user_id='+id,
            success: function(layero){
                layero.find('.layui-layer-min').remove();
            }
        });
    }

    //限制借款
    function limit_apply(id,mobile,status){
        var title='';
        if(status=='4'){
            title ='  将取消手机号码为：'+mobile+"的用户的限制, 是否继续?";
        }else {
            title ='手机号码为：'+mobile+"的用户将被限制申请,还要继续吗？";
        }
        layer.confirm(title, function (index) {
            layer.close(index);
            $.post('__MODULE__/User/limit_apply', {
                    id: id,status:status
                },
                function (data) {
                    if (data.code == '1001') {
//                        var tr_id='#'+id;
//                        var bt_id='#'+mobile;
//                        var val=data.b_status;
//                        var bt_val=data.button_status;
//                        $(tr_id).html(val);
//                        $(bt_id).html(bt_val);
//                        layer.msg(data.result, {icon: 6, time: 1000});
                        window.location.reload();
                    } else if (data.code == '1002') {
                        layer.msg(data.result, {icon: 5, time: 1000});
                    }
                }, 'json');
        });


    }
    //个人详情
    function into_detail(id) {
        layer.load(4);
        window.location.href='__MODULE__/User/user_detail?u_id='+id;

        $.post('__MODULE__/User/user_detail', {u_id:id}, function (data) {
            layer.closeAll('loading');
        });



    }

    //日期时间范围
    laydate.render({
        elem: '#should_time'
        ,type: 'datetime'
        ,range: true
    });
//    //日期时间范围
//    laydate.render({
//        elem: '#cert_time'
//        ,type: 'datetime'
//        ,range: true
//    });






    $(document).ready(function () {
        $('.fancybox').fancybox({
            openEffect: 'none',
            closeEffect: 'none'
        });
    });


    function copyval() {
//        event.returnValue = false;
        var content = '【待审核用户】列表复制：'+window.getSelection().toString();
        $.post('__MODULE__/Mypublic/copy_all', {content:content}, function (data) {
            if (data.code == '1001') {
            } else {
                console.log(data);
            }
        });
//        console.log(content)
    }

</script>


</body>

</html>
